import React, { PropTypes } from 'react';
import { Router, Route, IndexRoute, Link } from 'dva/router';
import Login from './pages/Login';
import IndexPage from './pages/IndexPage';
import Content from './pages/Content';
import Index from './pages/Index';
import Problem from './pages/Problem';
import PersonData from './pages/PersonData';
import CourseWare from './pages/CourseWare';
import CourseArrange from './pages/CourseArrange';
import StudentManage from './pages/StudentManage';
import News from './pages/News';

export default function({ history }) {
  return (
    <Router history={history}>
      <Route path="/" component={IndexPage} >
          <IndexRoute component={Login}/>
          <Route path="login" component={Login} />
          <Route path="app" component={Content}>
              <IndexRoute component={Index}/>
              <Route path="index" component={Index} />
              <Route path="ask" component={Problem} />
              <Route path="data" component={PersonData} />
              <Route path="plan" component={CourseArrange} />
              <Route path="student" component={StudentManage} />
              <Route path="courseware" component={CourseWare} />
              <Route path="news" component={News} />
          </Route>
      </Route>
    </Router>
  );
};
